package com.maserb.monitor.entity.card;

import com.maserb.monitor.entity.BaseIdEntity;
import com.maserb.monitor.entity.UserEntity;
import com.maserb.monitor.entity.schoolStudent.SchoolStudentEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * 充值记录
 */
@Entity
@Table(name = "recharge_record")
public class RechargeRecordEntity extends BaseIdEntity {

    /**
     * 学生
     */
    private SchoolStudentEntity student;

    /**
     * 老师
     */
    private UserEntity teacher;

    /**
     * 卡号
     */
    private String cardNumber;

    /**
     * 充值时间
     */
    private Date createTime;

    /**
     * 充值金额
     */
    private Double totalAmount;

    /**
     * 支付状态
     */
    private String payStatus;

    /**
     * 充值状态 由卡德返回
     * 0 未领用  1 已领用
     */
    private String rechargeStatus;

    /**
     * 备注
     */
    private String remarks;

    @Column(name = "card_number", length = 50)
    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    @Column(name = "total_amount",columnDefinition="double(10,2)")
    public Double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Double totalAmount) {
        this.totalAmount = totalAmount;
    }

    @Column(name = "pay_status", length = 2)
    public String getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(String payStatus) {
        this.payStatus = payStatus;
    }

    @Column(name = "recharge_status", length = 2)
    public String getRechargeStatus() {
        return rechargeStatus;
    }

    public void setRechargeStatus(String rechargeStatus) {
        this.rechargeStatus = rechargeStatus;
    }

    @Column(name = "remarks")
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "student_id")
    public SchoolStudentEntity getStudent() {
        return student;
    }

    public void setStudent(SchoolStudentEntity student) {
        this.student = student;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "teacher_id")
    public UserEntity getTeacher() {
        return teacher;
    }

    public void setTeacher(UserEntity teacher) {
        this.teacher = teacher;
    }
}
